package com.jason.quartzdemo.beans;

import org.quartz.JobDetail;
import org.quartz.Trigger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class JobScheduling {

   @Autowired
    @Qualifier("trigger2")
    Trigger trigger2;

    @Autowired
    @Qualifier("jobDetail")
    JobDetail jobDetail;

    /*@PostConstruct
    public void scheduler() throws SchedulerException {
        SchedulerFactory factory = new StdSchedulerFactory();
        Scheduler scheduler = factory.getScheduler();

        //开启调度器 定时任务开始 方法二


        scheduler.scheduleJob(jobDetail,trigger2);

        scheduler.start();
    }*/
}
